<?php
extract(array(
	'sort_items' => array(),
	'pagination_id' => 'pagination_contents',
	'show_sort_by' => true,
	'show_view_layout' => true,
	'sortby' => 'timestamp',
	'sortdir' => 'desc',
	'paging_text' => 'Displaying from <strong>%s - %s</strong> in <strong>%s</strong> total',
	'class' => 'pagination'
), EXTR_SKIP);

?>

<div class="row-fluid sortings-holder">
	
	<div class="span7 mnofloat">
		<?php
		if ( $show_sort_by && !empty($sort_items) ) {
			
			//printf('Xem theo &nbsp; ');
		
			$this->renderPartial('//common/dropdown', $sort_items);
		}

		if ( $show_view_layout ) : ?>
			<?php if ( $view_type == 'list' ) : ?>
			<a class="sorting sorting-list cm-ajax" rev="<?php echo $pagination_id ?>" href="<?php echo add_query_arg(array('view_layout' => 'grid')) ?>"><i class="icon-sorting-grid">Xem dạng lưới</i></a>
			<?php elseif ( $view_type == 'grid' ) : ?>
			<a class="sorting sorting-list cm-ajax" rev="<?php echo $pagination_id ?>" href="<?php echo add_query_arg(array('view_layout' => 'list')) ?>"><i class="icon-sorting-list">Xem dạng danh sách</i></a>
			<?php endif; ?>
		<?php endif; ?>
	</div>
	<!--
	<div class="span5 mnofloat text-right">
		<?php printf($paging_text, $pagination->offset + 1, $pagination->offset + $pagination->pageSize > $pagination->itemCount ? $pagination->itemCount : $pagination->offset + $pagination->pageSize, $pagination->itemCount); ?>
	</div>
	-->
	<?php
		$pager = array(
			'pages' => $pagination,
			'cssFile' => false,
			'itemOptions' => array(
				'class' => 'cm-ajax',
				'rev' => $pagination_id,
				'name' => 'pagination',
			),
		);
		printf('<div class="%s hidden-xs hidden-sm">', $class);
		$this->widget('MyLinkPager', $pager); 
		printf('</div>');
	?>
</div>